package com.edu.exam.enums.examination.paper;

/**
 * OMR质量状态枚举
 *
 * @author System
 * @version 1.0.0
 */
public enum OmQualityStatus {
    QUALIFIED("QUALIFIED", "合格"),
    UNQUALIFIED("UNQUALIFIED", "不合格"),
    BORDERLINE("BORDERLINE", "边缘"),
    EXCELLENT("EXCELLENT", "优秀"),
    NEEDS_REVIEW("NEEDS_REVIEW", "需复核"),
    AUTO_PASSED("AUTO_PASSED", "自动通过"),
    AUTO_REJECTED("AUTO_REJECTED", "自动拒绝"),
    MANUAL_REVIEW("MANUAL_REVIEW", "人工复核"),
    PENDING("PENDING", "待检测"),
    PROCESSING("PROCESSING", "检测中");

    private final String code;
    private final String description;

    OmQualityStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static OmQualityStatus fromCode(String code) {
        for (OmQualityStatus status : OmQualityStatus.values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown OMR quality status code: " + code);
    }

    @Override
    public String toString() {
        return description;
    }
}
